﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Abstract
{
    class Client
    {
        private string mClienName;
        private string mClientAge;
        private List<AbstractCar> mClientCars;
        private ConcreteFactory mFactory;

        public string ClientName
        {
            get { return mClienName; }
            set { mClienName = value; }
        }
        public string ClientAge
        {
            get { return mClientAge; }
            set { mClientAge = value; }
        }
        public Client(string name, string age, ConcreteFactory factory)
        {
            this.ClientName = name;
            this.ClientAge = age;
            this.mFactory = factory;
            this.mClientCars = new List<AbstractCar>();
        }

        public void OrderCar(AbstractCar.Cars type, AbstractCar.Colors color, AbstractCar.Transmissions transmission)
        {
            AbstractCar car = this.mFactory.OrderCar(type, color,transmission);
            this.mClientCars.Add(car);
        }

        public void aboutClient()
        {
               Console.WriteLine("Name\t:\t"+ClientName );
               Console.WriteLine("Age\t:\t"+ClientAge );
               foreach(AbstractCar car in mClientCars)
                   car.aboutCar();
        }
    }
}
